package com.bookpavilion.article.dao;

import com.bookpavilion.article.pojo.Comment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

public interface CommentDao extends MongoRepository<Comment,String> {
    /**
     * 根据文章ID查询评论列表
     * @param articleId 文章ID
     * @return
     */
    public Page<Comment> findByArticleid(String articleId,Pageable pageable);

    /**
     * 查找当前的文章或者评论的所有评论
     * @param parentId
     * @return
     */
    public Page<Comment> findByParentid(String parentId, Pageable pageable);


}
